<div class="vheader">
    <h1><?php echo $this->translate("Performance to date") ?></h1>
    <p><?php echo $this->translate("Officers") ?>
</div>

<div class="vcontent">
<table border="0" cellpadding="0" cellspacing="0">
    <thead>
        <td style="border-bottom: 2px solid #8ab;"></td>
        <?php foreach ($this->indicators as $indicator): ?>
            <td style="border-bottom: 2px solid #8ab;"><?php echo $indicator['label'] ?></td>
        <?php endforeach; ?>
    </thead>
    <tbody>
    <?php foreach ($this->pd as $location => $data): ?>    
        <tr style="border-bottom: 2px solid #8ab;">
            <td style="border-right: 1px solid #8ab;"></td>
            <td colspan="<?php echo count($this->indicators) ?>"><?php echo $location ?></td>
        </tr>
        <?php foreach ($data as $officer => $row): ?>
        <tr>
            <td style="border-right: 1px solid #8ab;">
                <a id="<?php echo $row['Score']['OfficerUserId'] ?>"></a>
                <?php echo $this->link('/admin/officer/performance-chart', 
                        array('id' => $row['Score']['OfficerUserId']), $officer); ?>
            </td>
            <?php foreach ($this->indicators as $indicator => $opt): ?>
            <td id="<?php echo $row[$indicator]['Metric'] ?>.<?php echo $row[$indicator]['OfficerUserId'] ?>"  
                class="<?php echo $row[$indicator]['Color'] ?>"><?php echo number_format($row[$indicator]['Value'],$opt['decimals'],'.',',') ?></td>
            <?php endforeach; ?>
        </tr>
        <?php endforeach; ?>
    <?php endforeach; ?>
    </tbody>
</table>  

</div> 

<div class="vfooter">
 <div class="menu">
     <?php echo $this->link('/admin/performance-data/location', array(), $this->translate("Locations")); ?>
     <?php echo $this->link('', array(), $this->translate("Officers"), array('text' => true)); ?>
     <?php echo $this->link('/admin/performance-data/product-line', array(), $this->translate("Lines")); ?>
     <?php echo $this->link('/admin/performance-data/program', array(), $this->translate("Programs")); ?>
 </div>
</div>   

<style>
    td { padding: 8px 15px 8px 15px; font-size: 11px; text-align: center; }
    td.green { background: transparent url('/css/images/scoreGreen2.png') no-repeat center;}
    td.yellow { background: transparent url('/css/images/scoreYellow2.png') no-repeat center;}
    td.orange { background: transparent url('/css/images/scoreOrange2.png') no-repeat center;}
    td.red { background: transparent url('/css/images/scoreRed2.png') no-repeat center;}
    
    table.legend td { padding: 2px 4px 2px 4px; font-size: 10px; text-align: center; }
</style>

<!-- Tooltips -->
<div style="visibility: hidden">
<?php foreach ($this->pd as $data): ?>
<?php foreach ($data as $officer => $row): ?>
    <?php foreach ($row as $indicator => $col): ?>
    <div data-dojo-type="dijit.Tooltip" data-dojo-props="connectId:'<?php echo $col['Metric'] ?>.<?php echo $col['OfficerUserId'] ?>',position:['below','above']">
        <?php echo $col['FullName'] ?><br />
        <?php echo $this->indicators[$col['Metric']]['label'] ?>: <?php echo number_format($col['Value'],$this->indicators[$indicator]['decimals'],'.',',') ?>
        - <?php echo $col['Score'] ?> <?php echo $this->translate("Points") ?>
        <br />
        <table class="legend" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td width='40px'></td>
                <td width='40px'></td>
                <td width='40px'></td>
                <td width='40px'></td>
                <td width='40px'></td>
                <td width='40px'></td>
                <td width='40px'></td>
                <td width='40px'></td>
            </tr>
            <tr>
                <td></td>
                <td align='center' colspan="2"><?php echo number_format($col['A'],$this->indicators[$indicator]['decimals'],'.',',') ?></td>
                <td align='center' colspan="2"><?php echo number_format($col['B'],$this->indicators[$indicator]['decimals'],'.',',') ?></td>
                <td align='center' colspan="2"><?php echo number_format($col['C'],$this->indicators[$indicator]['decimals'],'.',',') ?></td>
                <td></td>
            </tr>
            <tr>
                <td colspan="2" bgcolor="<?php echo $col['ColorAA'] ?>"></td>
                <td colspan="2" bgcolor="<?php echo $col['ColorAB'] ?>"></td>
                <td colspan="2" bgcolor="<?php echo $col['ColorBC'] ?>"></td>
                <td colspan="2" bgcolor="<?php echo $col['ColorCC'] ?>"></td>
            </tr>
            <tr>
                <td colspan="2"><?php echo $col['ScoreAA'] ?></td>
                <td colspan="2"><?php echo $col['ScoreAB'] ?></td>
                <td colspan="2"><?php echo $col['ScoreBC'] ?></td>
                <td colspan="2"><?php echo $col['ScoreCC'] ?></td>
            </tr>
        </table>
    </div>
    <?php endforeach; ?>
<?php endforeach; ?>
    <?php endforeach; ?>
</div>
<!-- Tooltips /-->